If we pushNotification the same notification multiple times, we
won't append it to the array again, but we will attach multiple
handlers needlessly.
https://bugzilla.gnome.org/show_bug.cgi?id=710115
},
pushNotification: function(notification) {
- if (this.notifications.indexOf(notification) < 0) {
- this.notifications.push(notification);
- this.emit('notification-added', notification);
- }
+ if (this.notifications.indexOf(notification) >= 0)
+ return;
notification.connect('clicked', Lang.bind(this, this.open));
notification.connect('destroy', Lang.bind(this,
this.countUpdated();
}));
+ this.notifications.push(notification);
+ this.emit('notification-added', notification);
+
this.countUpdated();
},